<script id="template_creative" type="text/html">
    <% for(var i = 0; i < data.length; i ++) { var index = i + 1;%>
    <div class="creative" data-creative="<%=index%>" data-product-id="<%= data[i].num_iid%>">
        <h5>推广内容<%=index%></h5>
        <div class="product_img" style="float:left">
            <div class="photopreview">
                <img class="th" width="160px" id="creative_img<%=index%>_<%= data[i].num_iid%>" src="<%= data[i].img_url%>_160x160.jpg">
            </div>
        </div>
        <div class="product_detail">
            <div class="last" id="img_list<%=index%>_<%= data[i].num_iid%>">
                <div class="field imgs_selector" style="border:1px solid #CCC">
                    <% for(var j = 0; j <= data[i].item_imgs.length; j ++) { %>
                    <% if(data[i].item_imgs[j]) { %>
                    <div class="listed_pic picture<%=index%> <%if(data[i].item_imgs[j] == data[i].img_url){%> selected<%}%>" rel="<%= data[i].num_iid%>">
                        <a href="javascript:void(0);"><img class="creative-img" width="130px" src="<%= data[i].item_imgs[j]%>_160x160.jpg" data-src="<%= data[i].item_imgs[j]%>" name="itemImg"></a>
                    </div>
                    <%}%>
                    <%}%>
                    <input type="hidden" name="creative[<%=index%>][img_url]" value="<%= data[i].img_url%>" id="selected_img<%=index%>_<%= data[i].num_iid%>">
                </div>
                <br class="clear">
            </div>
            <p>
                <label>推广标题<%=index%> (不超过20个汉字)</label>
                <label class="exceeded_warning" id="titleLengthLimit<%=index%>_536507397578" style="padding:0 5px"></label>
                <input type="text" name="creative[<%=index%>][title]" class="product_title title<%=index%>" value="<%= data[i].title%>" rel="<%= data[i].num_iid%>" maxlength="40">
            </p>
        </div>
    </div>
    <%}%>
</script>